/**
 * Created by IntelliJ IDEA.
 * User: mstine
 * Date: Mar 20, 2008
 * Time: 2:45:21 PM
 * To change this template use File | Settings | File Templates.
 */
class Person {
    String firstname
    String lastname
    String toString(){"${firstname} ${lastname}"}

    MetaProperty hasProperty(String property) {
        return this.metaClass.hasProperty(this, property)
    }
}

def person = new PointerPerson()

request.parameterMap.each{name, value->
    if (person.hasProperty(name)) {
        person.setProperty(name, value[0])
    }
}

println "QueryString: ${request.queryString}"
println "<br/>"
println "Incoming parameters: ${request.parameterMap}"
println "<br/>"
println "Resulting Person: ${person}"
